#!/usr/bin/python3
import sys
from optparse import OptionParser

def cal(cur_price):
    return (cur_price - 31.85) * 1000

def _get_opt_parser():
    ''' get option parser '''

    MSG_USAGE = '''%prog -c <current_price>'''
    opt_parser = OptionParser(MSG_USAGE)

    opt_parser.add_option("-c", "--current_price", action = "store", type = "string",
            dest = "cur_price", help='''Current price. ''', default="")

    return opt_parser

def main(args):
    # parser options
    parser = _get_opt_parser()
    (options, _) = parser.parse_args(args)
    cur_price = options.cur_price
    if not cur_price:
        print('cur_price must be exist!')
        sys.exit()
    ret = cal(float(cur_price))
    print("you can get [{:.2f}] CNY..".format(ret))

if __name__ == '__main__':
    main(sys.argv[1:])

